#pragma once

#include "ModelessDialog.h"

// AcctDlg dialog

class AcctDlg : public CModelessDialog, public L_Observer
{
	DECLARE_DYNAMIC(AcctDlg)

public:
	AcctDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~AcctDlg();

	virtual BOOL Create(CWnd *pParentWnd = CWnd::FromHandle(L_GetMainWnd()));

	virtual BOOL OnInitDialog();
	afx_msg void OnSize(UINT nType, int cx, int cy);

// Dialog Data
	enum { IDD = IDD_ACCTDLG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

protected:
// L_Observer
	virtual void HandleMessage(L_Message const *pMsg);

private:
	CListCtrl m_AcctDataListCtrl;
	char APIFunctions[64][32];
	void SetAPIFunctions();
	void InitializeDataCtrlRows();
	void UpdateDynamicAccountValues();
	void UpdateOrderChangeValues();
	void InsertStaticValues();
	CString GetTextForFunction(int function);
	void ResizeControls();

	L_Account *account;

public:
	afx_msg void OnViewPositions();
	afx_msg void OnViewOrders();
};
